package com.gzjh_group.photoalbum.activity;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.IntentUtils;
import com.blankj.utilcode.util.SPUtils;
import com.gzjh_group.photoalbum.MainActivity;
import com.gzjh_group.photoalbum.R;

import butterknife.ButterKnife;

public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        boolean isFirst = SPUtils.getInstance().getBoolean("isFirst", false);
        if (!isFirst){
            SPUtils.getInstance().put("isFirst", true);
            ActivityUtils.startActivity(new Intent(this, GuideActivity.class));
            finish();
            return;
        }

        setContentView(R.layout.activity_splash);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                ActivityUtils.startActivity(new Intent(SplashActivity.this, MainActivity.class));
                finish();
            }
        }, 2000);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }
}
